package auth

import (
	"context"
	"meta-self/internal/service"

	"meta-self/api/client/auth/v1"
)

func (c *ControllerV1) Register(ctx context.Context, req *v1.RegisterReq) (res *v1.RegisterRes, err error) {
	result, err := service.ClientAuth().Register(ctx, &req.RegisterInp)
	if err != nil {
		return nil, err
	}
	res = &v1.RegisterRes{RegisterModel: result}
	return
}
func (c *ControllerV1) Login(ctx context.Context, req *v1.LoginReq) (res *v1.LoginRes, err error) {
	result, err := service.ClientAuth().Login(ctx, &req.LoginInp)
	if err != nil {
		return nil, err
	}
	res = &v1.LoginRes{LoginModel: result}
	return
}
